package com.k.base.jdk.proxy.demo1;

import java.lang.reflect.Proxy;

/**
 * @author k
 */
public class Test {
    public static void main(String[] args) {
        // origin object
        Car carOrigin = new BmwCar();
        // proxy object
        Car carProxy = (Car) Proxy.newProxyInstance(Car.class.getClassLoader(),new Class[]{Car.class},new CarInvocationHandler(carOrigin));
        carProxy.run();

    }
}
